#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

       

int main()
{
	int fd,status=0;
	fd = open("/dev/drv_led", O_RDWR);
	if(fd < 0)
	{
		printf("drv_led open err\r\n");
		exit(1);
	}
	while(1)
	{
		write(fd, &status, sizeof(int));
		sleep(1);
		if(status)
		{
			status=0;
		}
		else
		{
			status=1;
		}
	}
	close(fd);
}
